import request from "@/utils/request";


//查询图书 // 使用axios的params参数，让axios自动处理参数构建和编码
export const queryApiBook = (ISBN,category,begin,end,page,pageSize) =>{
  // 构建查询参数对象
  const params = {
    ISBN: ISBN || undefined,
    category: category || undefined,
    begin: begin || undefined,
    end: end || undefined,
    page: page,
    pageSize: pageSize
  };

// 使用axios的params参数，让axios自动处理参数构建和编码
  return request.get('/books/borrow/page', { params });
}

//借阅图书
export const borrowApiBook = (userbooks) => request.post('/books/borrowbook', userbooks);



